home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / GAMMANS / SOCKFS-0.ZIP / C / Tstnmproc < prev   
Text File  |  1997-08-17  |  3KB  |  71 lines

  1. /***************************************************************************/
  2. /* Program       : SocketFS                                                */
  3. /* Purpose       : A BSD sockets filesystem for RISCOS                     */
  4. /* File          : TstNmProc.c                                             */
  5. /* Description   : Tests the filename processor.                           */
  6. /* Author        : R G Gammans                                             */
  7. /* Date Created  :                                                         */
  8. /* Last Edited   :                                                         */
  9. /*                                                                         */
  10. /* Copyright Date:                                                         */
  11. /*                                                                         */
  12. /***************************************************************************/
  13. /*
  14.  *   SocketFS - BSD sockets filing system for RISC-OS.
  15.  *   Copyright (C) 1997 Roger G Gammans
  16.  *
  17.  *   This program is free software; you can redistribute it and/or modify
  18.  *   it under the terms of the GNU General Public License as published by
  19.  *   the Free Software Foundation; either version 2 of the License, or
  20.  *   (at your option) any later version.
  21.  *
  22.  *
  23.  *   This program is distributed in the hope that it will be useful,
  24.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  25.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  26.  *   GNU General Public License for more details.
  27.  *
  28.  *   You should have received a copy of the GNU General Public License
  29.  *   along with this program; if not, write to the Free Software
  30.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  31.  *
  32.  *   Author: R Gammans <rgammans@compsurg,demon.co.uk>
  33.  *   Snailmail  : 20 Trenches Rd, Crowborough, E Sussex, TN6 1ES UK.
  34.  */
  35.  
  36. #include <stdio.h>
  37. #include <errno.h>
  38.  
  39. extern int  makeSocket(char*, char*);
  40. extern void inithandlerlist();
  41.  
  42. extern char* errstr;
  43.  
  44. int main (int argc,char* argv[])
  45.  {
  46.    int s;
  47.  
  48.    if  (argc>1) {
  49.      argc--;
  50.      argv++;
  51.      inithandlerlist();
  52.      while (argc>0) {
  53.        errstr="";
  54.        s=makeSocket(0,argv[0]);
  55.        if (s!=-1) {
  56.          printf("%s is sockect number - %d\n",argv[0],s);
  57.         } else {
  58.          printf("Err no %d\n errmsg %s",errno,errstr);
  59.        }
  60.        argc--;
  61.        argv++;
  62.      }
  63.    } else {
  64.      printf("TstNmPrc takes socketfs style filenames as parameters\n");
  65.    }
  66.   return 0;
  67.  
  68.  }
  69.  
  70.  
  71.